﻿using System;
using System.Collections;

namespace SedionFormDesigner.Infrastructure
{
    /// <summary>
    ///  对字符串事件了非null处理的堆栈
    /// </summary>
    internal class StringStack : Stack
    {
        internal StringStack() { }

        internal String GetNonNull()
        {
            Int32 items = this.Count;
            Object item;
            Object[] itemArr = this.ToArray();
            for (int i = items - 1; i >= 0; i--)
            {
                item = itemArr[i];
                if (item != null && item is String && ((String)item).Length > 0)
                {
                    return (String)item;
                }
            }

            return String.Empty;
        }
    }
}
